
import java.util.Scanner;

public class Main6 {

    private static Scanner in;

    public static void main(String[] args) {
        in = new Scanner(System.in);
        String s = in.nextLine();
        while (s.compareTo("new") == 0) {
            String k = in.nextLine();
            String a[] = k.split(" ");
            Student student = new Student();
            try {

                student.setName(a[0]);
                try {
                    Integer b = Integer.parseInt(a[1]);
                    student.addScore(b);
                    System.out.println(student);
                } catch (IllegalScoreException e) {
                    System.out.println(e);
                } catch (Exception e) {
                    System.out.println("java.util.NoSuchElementException");
                }

            } catch (IllegalNameException e) {
                System.out.println(e);
            } catch (Exception e) {
                System.out.println(e);
            }
            s = in.nextLine();
        }
        try {
            in.close();
            System.out.println("scanner closed");
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}

class IllegalScoreException extends Exception {

    public IllegalScoreException(String s) {
        super(s);
    }
}

class IllegalNameException extends RuntimeException {

    public IllegalNameException(String s) {
        super(s);
    }
}

class Student {

    private String name;
    private int score;

    public int addScore(int score) throws IllegalScoreException {
        if (score > 100 || score < 0) {
            throw new IllegalScoreException("score out of range, score=" + score);
        }
        this.score = score;
        return score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) throws IllegalNameException {
        if (name.charAt(0) >= '0' && name.charAt(0) <= '9') {
            throw new IllegalNameException("the first char of name must not be digit, name=" + name);
        }
        this.name = name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student [" + "name=" + name + ", score=" + score + ']';
    }

}
